/*
 * @copyright fxsen <br/>
 * @date 2022/4/18 14:41 <br/>
 * @email <a href="mailto:fxsen@foxmail.com">
 * @author fxsen
 */
package com.fxsen.commons.sysmanager.core.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fxsen.commons.core.base.common.entity.BaseEntity;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;

/**
 * 操作日志
 * @author fxsen
 * @date 2022/4/18 14:41
 * @email <a href="mailto:fxsen@foxmail.com">
 */
@ApiModel("操作日志")
@EqualsAndHashCode(callSuper = true)
@TableName("sys_operation_log")
@TableComment(value = "操作日志表")
public class OperationLog extends BaseEntity {
    private static final long serialVersionUID = 4632041487950235723L;

    @ApiModelProperty("操作人")
    @TableField(value = "operation_user")
    @Column(name = "operation_user", type = MySqlTypeConstant.VARCHAR, comment = "操作人",length = 255)
    private String operationUser;

    @ApiModelProperty("操作名称")
    @TableField(value = "name")
    @Column(name = "name", type = MySqlTypeConstant.VARCHAR, comment = "操作名称",length = 255)
    private String name;

    @ApiModelProperty(value = "类型（0登录，1正常操作，2异常）",example = "1")
    @TableField(value = "type")
    @Column(name = "type", type = MySqlTypeConstant.INT, comment = "类型（0登录，1正常操作，2异常）",length = 1)
    private int type;

    @ApiModelProperty("方法名称")
    @Column(name = "method_name", type = MySqlTypeConstant.VARCHAR, comment = "请求方式",length = 255)
    @TableField(value = "method_name")
    private String methodName;

    @ApiModelProperty("请求方法")
    @Column(name = "request_method", type = MySqlTypeConstant.VARCHAR, comment = "请求方法",length = 20)
    @TableField(value = "request_method")
    private String requestMethod;

    @ApiModelProperty("请求路径")
    @TableField(value = "request_url")
    @Column(name = "request_url", type = MySqlTypeConstant.VARCHAR, comment = "请求路径",length = 255)
    private String requestUrl;

    @ApiModelProperty("请求IP")
    @TableField(value = "request_ip")
    @Column(name = "request_ip", type = MySqlTypeConstant.VARCHAR, comment = "请求IP",length = 128)
    private String requestIp;

    @ApiModelProperty("请求真实地址")
    @TableField(value = "real_address")
    @Column(name = "real_address", type = MySqlTypeConstant.VARCHAR, comment = "请求真实地址",length = 255)
    private String realAddress;

    @ApiModelProperty("请求参数")
    @TableField(value = "param")
    @Column(name = "param", type = MySqlTypeConstant.VARCHAR, comment = "请求参数",length = 2000)
    private String param;

    @ApiModelProperty("异常信息")
    @TableField(value = "ex_message")
    @Column(name = "ex_message", type = MySqlTypeConstant.TEXT, comment = "异常信息")
    private String exMessage;

    @ApiModelProperty("请求耗时")
    @TableField(value = "time")
    @Column(name = "time", type = MySqlTypeConstant.INT, comment = "请求耗时",length = 11,defaultValue = "0")
    private long time;

    @ApiModelProperty("浏览器")
    @TableField(value = "browser")
    @Column(name = "browser", type = MySqlTypeConstant.VARCHAR, comment = "浏览器",length = 50)
    private String browser;

    public String getOperationUser() {
        return operationUser;
    }

    public void setOperationUser(String operationUser) {
        this.operationUser = operationUser;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getRequestMethod() {
        return requestMethod;
    }

    public void setRequestMethod(String requestMethod) {
        this.requestMethod = requestMethod;
    }

    public String getRequestUrl() {
        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }

    public String getRequestIp() {
        return requestIp;
    }

    public void setRequestIp(String requestIp) {
        this.requestIp = requestIp;
    }

    public String getRealAddress() {
        return realAddress;
    }

    public void setRealAddress(String realAddress) {
        this.realAddress = realAddress;
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }

    public String getExMessage() {
        return exMessage;
    }

    public void setExMessage(String exMessage) {
        this.exMessage = exMessage;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getBrowser() {
        return browser;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }
}
